package com.gc.server.vo.down;


import lombok.Data;

import java.util.Date;

import com.alibaba.excel.annotation.*;

import java.io.Serializable;


import com.gc.server.entity.UserHeadEntity;
import com.gc.server.vo.UserHeadVo;


/**
 * 用户总部关系实体
 * 表名 user_head
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date ${datetime}
 */
@Data
public class UserHeadDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    //
    @ExcelProperty("")
    private Long id;

    //用户ID
    @ExcelProperty("用户ID")
    private Long userId;

    //用户ID
    @ExcelProperty("用户名")
    private String name;

    //用户ID
    @ExcelProperty("用户编号")
    private String code;

    //总部ID
    @ExcelProperty("总部ID")
    private Long headId;

    @ExcelProperty("总部名")
    private String headName;

    @ExcelProperty("总部编号")
    private String headCode;

    //备注
    @ExcelProperty("备注")
    private String remark;


    public UserHeadDown() {

    }

    public UserHeadDown(UserHeadVo vo) {
        UserHeadEntity entity = vo.getEntity();
        this.setId(entity.getId());
        this.setUserId(entity.getUserId());
        if(vo.getUser()!=null){
            this.setCode(vo.getUser().getCode());
            this.setName(vo.getUser().getName());
        }
        if(vo.getHead()!=null){
            this.setHeadCode(vo.getHead().getCode());
            this.setHeadName(vo.getHead().getName());
        }
        this.setHeadId(entity.getHeadId());
        this.setRemark(entity.getRemark());

    }


}
